package com.atung.dao;

import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.UpdateProvider;

import com.atung.model.BusSchoolUser;
import com.atung.provider.BusSchoolUserProvider;


@Mapper
public interface SchoolUserDAO {

	/**
	 * 根据openId获取用户信息
	 * @param openId
	 * @return
	 */
	@Select("Select * from bus_school_user where open_id=#{openId} order by id ")
	BusSchoolUser selectUserAndOpenId(@Param("openId") String openId);
	
	/**
	 * 新增用户
	 * @param busSchoolUser
	 * @return
	 */
	@InsertProvider(type=BusSchoolUserProvider.class,method="insertUserProvide")
	Boolean insertUser(BusSchoolUser busSchoolUser);
	
	/**
	 * 完善信息
	 * @param busSchoolUser
	 * @return
	 */
	@UpdateProvider(type=BusSchoolUserProvider.class,method="updateUserProvide")
	Boolean updatetUserAndOpenId(BusSchoolUser busSchoolUser);
	
}
